<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>古诗词</title>
<!--    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">-->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    　
    <style type="text/css">
        div {
            text-align: center;
        }

        table {
            margin: auto;
        }



         .table th, .table td {

             text-align: center;

             vertical-align: middle!important;

         }

        td{font-size:24pt}
　　　　　　</style>

</head>
<body>


<div class="container theme-showcase">
    <div class="text-center">
        <h1>唐诗绝句搜索系统</h1>
    </div>
    <div class="text-center">
        <input  id="click5"   type="radio" checked="checked"  onclick="click5(this)" > <b style="font-size:20px">五言</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="click7" type="radio"  name="1" onclick="click7(this)"/> <b style="font-size:20px">七言</b>
    </div>
    <div  id="tvt7" style="display:none;">
    <div class=" container">
        <input type="hidden" id="verse7" value="0">
        <input type="hidden" id="verse71" value="0">
        <input type="hidden" id="verse72" value="0">
        <input type="hidden" id="verse73" value="0">
        <table id="test7" class="table table-bordered"  style="table-layout: fixed;">
            <thead>

            </thead>

            <tbody class="table table-striped">
            <tr>
                <th id="a71" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="a72" style="text-align:center;" onclick="tdclick7(this)">*</th>
                <th id="a73" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="a74" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="a75" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="a76" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="a77" style="text-align:center; " onclick="tdclick7(this)">*</th>
            </tr>
            <tr>
                <th id="b71" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="b72" style="text-align:center;" onclick="tdclick7(this)">*</th>
                <th id="b73" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="b74" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="b75" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="b76" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="b77" style="text-align:center; " onclick="tdclick7(this)">*</th>
            </tr>
            <tr>
                <th id="c71" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="c72" style="text-align:center;" onclick="tdclick7(this)">*</th>
                <th id="c73" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="c74" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="c75" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="c76" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="c77" style="text-align:center; " onclick="tdclick7(this)">*</th>
            </tr>
            <tr>
                <th id="d71" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="d72" style="text-align:center;" onclick="tdclick7(this)">*</th>
                <th id="d73" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="d74" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="d75" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="d76" style="text-align:center; " onclick="tdclick7(this)">*</th>
                <th id="d77" style="text-align:center; " onclick="tdclick7(this)">*</th>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="container theme-showcase">
        <div class="text-center">
            <!-- 提供额外的视觉效果，标识一组按钮中的原始动作 -->
            <button type="button" class="btn btn-primary" onclick="qkclick7(this)">清空</button>
            <!-- 表示一个成功的或积极的动作 -->
            <button type="button" class="btn btn-success" onclick="query7(this)">查询</button>
            <!-- 表示一个成功的或积极的动作 -->
            <button type="button" class="btn btn-info" onclick="query777shang(this)">上一首</button>
            <!-- 表示一个成功的或积极的动作 -->
            <button type="button" class="btn btn-warning" onclick="query777xia(this)">下一首</button>
        </div>
    </div>
    </div>

    <div id="tvt5">
        <div class=" container">
            <input type="hidden" id="verse5" value="0">
            <input type="hidden" id="verse51" value="0">
            <input type="hidden" id="verse52" value="0">
            <input type="hidden" id="verse53" value="0">
            <table id="test5" class="table table-bordered"  style="table-layout: fixed;"  >

                <thead>

                </thead>

                <tbody class="table table-striped">
                <tr>
                    <th id="a1" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="a2" style="text-align:center;" onclick="tdclick(this)">*</th>
                    <th id="a3" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="a4" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="a5" style="text-align:center; " onclick="tdclick(this)">*</th>
                </tr>
                <tr>
                    <th id="b1" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="b2" style="text-align:center;" onclick="tdclick(this)">*</th>
                    <th id="b3" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="b4" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="b5" style="text-align:center; " onclick="tdclick(this)">*</th>
                </tr>
                <tr>
                    <th id="c1" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="c2" style="text-align:center;" onclick="tdclick(this)">*</th>
                    <th id="c3" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="c4" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="c5" style="text-align:center; " onclick="tdclick(this)">*</th>
                </tr>
                <tr>
                    <th id="d1" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="d2" style="text-align:center;" onclick="tdclick(this)">*</th>
                    <th id="d3" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="d4" style="text-align:center; " onclick="tdclick(this)">*</th>
                    <th id="d5" style="text-align:center; " onclick="tdclick(this)">*</th>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="container theme-showcase">
            <div class="text-center">
                <!-- 提供额外的视觉效果，标识一组按钮中的原始动作 -->
                <button type="button" class="btn btn-primary" onclick="qkclick5(this)">清空</button>
                <!-- 表示一个成功的或积极的动作 -->
                <button type="button" class="btn btn-success" onclick="query(this)">查询</button>
                <!-- 表示一个成功的或积极的动作 -->
                <button type="button" class="btn btn-info" onclick="query555shang(this)">上一首</button>
                <!-- 表示一个成功的或积极的动作 -->
                <button type="button" class="btn btn-warning" onclick="query555xia(this)">下一首</button>
            </div>
        </div>
    </div>
</div>



<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>


    function click5() {

        $("#click7").removeAttr("checked");
        document.getElementById("tvt7").style.display = "none"//不显示
        document.getElementById("tvt5").style.display = "block"//显示
        qkclick7()
    }

    function click7() {
        $("#click5").removeAttr("checked");
        document.getElementById("tvt5").style.display = "none"//不显示
        document.getElementById("tvt7").style.display = "block"//显示
        qkclick5()
    }
    function qkclick5() {
        // $('#test5 th').css("background","#229922");
        $('#test5 th').css({color:"black"});
        $("#a1").html("*");
        $("#a2").html("*");
        $("#a3").html("*");
        $("#a4").html("*");
        $("#a5").html("*");
        $("#d1").html("*");
        $("#d2").html("*");
        $("#d3").html("*");
        $("#d4").html("*");
        $("#d5").html("*");
        $("#c1").html("*");
        $("#c2").html("*");
        $("#c3").html("*");
        $("#c4").html("*");
        $("#c5").html("*");
        $("#b1").html("*");
        $("#b2").html("*");
        $("#b3").html("*");
        $("#b4").html("*");
        $("#b5").html("*");


            $("#verse51").val(0);
            $("#verse52").val(0);
            $("#verse53").val(0);

    }


    function qkclick7() {
        $('#test7 th').css({color:"black"});
        $("#a71").html("*");
        $("#a72").html("*");
        $("#a73").html("*");
        $("#a74").html("*");
        $("#a75").html("*");
        $("#a76").html("*");
        $("#a77").html("*");
        $("#d71").html("*");
        $("#d72").html("*");
        $("#d73").html("*");
        $("#d74").html("*");
        $("#d75").html("*");
        $("#d76").html("*");
        $("#d77").html("*");
        $("#c71").html("*");
        $("#c72").html("*");
        $("#c73").html("*");
        $("#c74").html("*");
        $("#c75").html("*");
        $("#c76").html("*");
        $("#c77").html("*");
        $("#b71").html("*");
        $("#b72").html("*");
        $("#b73").html("*");
        $("#b74").html("*");
        $("#b75").html("*");
        $("#b76").html("*");
        $("#b77").html("*");
        $("#verse71").val(0);
        $("#verse72").val(0);
        $("#verse73").val(0);
    }


    function count(){
        var count=0;

        //   alert($("#a1").text())
        // alert($("#a1").text()=="*")
        if($("#a1").text()=="*"){
            count=count+1;
        }
        if($("#a2").text()=='*'){
            count=count+1;
        }
        if($("#a3").text()=='*'){
            count=count+1;
        }
        if($("#a4").text()=='*'){
            count=count+1;
        }
        if($("#a5").text()=='*'){
            count=count+1;
        }
        if($("#b1").text()=='*'){
            count=count+1;
        }
        if($("#b2").text()=='*'){
            count=count+1;
        }
        if($("#b3").text()=='*'){
            count=count+1;
        }
        if($("#b4").text()=='*'){
            count=count+1;
        }
        if($("#b5").text()=='*'){
            count=count+1;
        }
        if($("#c1").text()=='*'){
            count=count+1;
        }
        if($("#c2").text()=='*'){
            count=count+1;
        }
        if($("#c3").text()=='*'){
            count=count+1;
        }
        if($("#c4").text()=='*'){
            count=count+1;
        }
        if($("#c5").text()=='*'){
            count=count+1;
        }
        if($("#d1").text()=='*'){
            count=count+1;
        }
        if($("#d2").text()=='*'){
            count=count+1;
        }
        if($("#d3").text()=='*'){
            count=count+1;
        }
        if($("#d4").text()=='*'){
            count=count+1;
        }
        if($("#d5").text()=='*'){
            count=count+1;
        }
     return count;
    }


    function count7(){
        var count=0;

        //   alert($("#a1").text())
        // alert($("#a1").text()=="*")
        if($("#a71").text()=="*"){
            count=count+1;
        }
        if($("#a72").text()=='*'){
            count=count+1;
        }
        if($("#a73").text()=='*'){
            count=count+1;
        }
        if($("#a74").text()=='*'){
            count=count+1;
        }
        if($("#a75").text()=='*'){
            count=count+1;
        }
        if($("#a76").text()=='*'){
            count=count+1;
        }
        if($("#a77").text()=='*'){
            count=count+1;
        }
        if($("#b71").text()=='*'){
            count=count+1;
        }
        if($("#b72").text()=='*'){
            count=count+1;
        }
        if($("#b73").text()=='*'){
            count=count+1;
        }
        if($("#b74").text()=='*'){
            count=count+1;
        }
        if($("#b75").text()=='*'){
            count=count+1;
        }
        if($("#b76").text()=='*'){
            count=count+1;
        }
        if($("#b77").text()=='*'){
            count=count+1;
        }
        if($("#c71").text()=='*'){
            count=count+1;
        }
        if($("#c72").text()=='*'){
            count=count+1;
        }
        if($("#c73").text()=='*'){
            count=count+1;
        }
        if($("#c74").text()=='*'){
            count=count+1;
        }
        if($("#c75").text()=='*'){
            count=count+1;
        }
        if($("#c76").text()=='*'){
            count=count+1;
        }
        if($("#c77").text()=='*'){
            count=count+1;
        }
        if($("#d71").text()=='*'){
            count=count+1;
        }
        if($("#d72").text()=='*'){
            count=count+1;
        }
        if($("#d73").text()=='*'){
            count=count+1;
        }
        if($("#d74").text()=='*'){
            count=count+1;
        }
        if($("#d75").text()=='*'){
            count=count+1;
        }
        if($("#d76").text()=='*'){
            count=count+1;
        }
        if($("#d77").text()=='*'){
            count=count+1;
        }
        return count;
    }

    function tdclick(tdobject) {

        if ( count()<18){
            alert("最多输入3个字")
            return
        }
        console.log(tdobject);

        if (count()==20){
            $("#verse51").val(tdobject.id);
        }
        if (count()==19){
            $("#verse52").val(tdobject.id);
        }
        if (count()==18){
            $("#verse53").val(tdobject.id);
        }
        var td = $(tdobject);
        td.attr("onclick", "");
        //1,取出当前td中的文本内容保存起来
        //2,清空td里面的内容
        td.html(""); //也可以用td.empty();
        //3，建立一个文本框，也就是input的元素节点
        var input = $("<input maxlength='1' style='width:100%'>");
        //4，设置文本框的值是保存起来的文本内容
        input.attr("value", "");
        input.bind("blur", function () {
            var inputnode = $(this);
            var inputtext = inputnode.val();
            var tdNode = inputnode.parent();
            tdNode.html(inputtext);
            tdNode.click(tdclick);
            td.attr("onclick", "tdclick(this)");
        });
        input.keyup(function (event) {
            var myEvent = event || window.event;
            var kcode = myEvent.keyCode;
            if (kcode == 13) {
                var inputnode = $(this);
                var inputtext = inputnode.val();
                var tdNode = inputnode.parent();

                tdNode.html(inputtext);
                tdNode.click(tdclick);
            }
        });


        //5，将文本框加入到td中
        td.append(input);
        tdobject.style='color:#89392D';
        var t = input.val();
        input.val("").focus().val(t);
//    input.focus();
        //6,清除点击事件
        td.unbind("click");
    }


    function tdclick7(tdobject) {


        if ( count7()<26){
            alert("最多输入3个字")
            return
        }
        if (count7()==28){

            $("#verse71").val(tdobject.id);
        }
        if (count7()==27){
            $("#verse72").val(tdobject.id);
        }
        if (count7()==26){
            $("#verse73").val(tdobject.id);
        }
        var td = $(tdobject);
        td.html(""); //也可以用td.empty();
        td.attr("onclick", "");
        //1,取出当前td中的文本内容保存起来
        var text = td.text();
        //2,清空td里面的内容

        //3，建立一个文本框，也就是input的元素节点
        var input = $("<input maxlength='1' style='width:100%'>");
        //4，设置文本框的值是保存起来的文本内容
        input.attr("value", "");
        input.bind("blur", function () {
            var inputnode = $(this);
            var inputtext = inputnode.val();
            var tdNode = inputnode.parent();
            tdNode.html(inputtext);
            tdNode.click(tdclick);
            td.attr("onclick", "tdclick7(this)");
        });
        input.keyup(function (event) {
            var myEvent = event || window.event;
            var kcode = myEvent.keyCode;
            if (kcode == 13) {
                var inputnode = $(this);
                var inputtext = inputnode.val();
                var tdNode = inputnode.parent();
                tdNode.html(inputtext);
                tdNode.click(tdclick);
            }
        });


        //5，将文本框加入到td中
        td.append(input);
        tdobject.style='color:#89392D';
        // tdobject.bgColor='#89392D';
        var t = input.val();
        input.val("").focus().val(t);
//    input.focus();
        //6,清除点击事件
        td.unbind("click");
    }
    function query() {
        if(count()==20){
            alert("请输入查询的内容，最多三个字！")
            return
        }
        var counts=0;
        $.post("/poetry/read5",
            {
                count:counts,
                oneSentence1:$("#a1").text(),
                oneSentence2:$("#a2").text(),
                oneSentence3:$("#a3").text(),
                oneSentence4:$("#a4").text(),
                oneSentence5:$("#a5").text(),
                twoSentence1:$("#b1").text(),
                twoSentence2:$("#b2").text(),
                twoSentence3:$("#b3").text(),
                twoSentence4:$("#b4").text(),
                twoSentence5:$("#b5").text(),
                threeSentence1:$("#c1").text(),
                threeSentence2:$("#c2").text(),
                threeSentence3:$("#c3").text(),
                threeSentence4:$("#c4").text(),
                threeSentence5:$("#c5").text(),
                fourSentence1:$("#d1").text(),
                fourSentence2:$("#d2").text(),
                fourSentence3:$("#d3").text(),
                fourSentence4:$("#d4").text(),
                fourSentence5:$("#d5").text()
            },
            function(data){
                console.log(data);
                if (data.oneSentence1==null){
                    alert("未查到数据，请重查！")
                    return
                }
                if (data.count==-1){
                    alert("已经是最后一首了！")
                    return
                }
                $("#verse5").val(data.count);
                $("#a1").html(data.oneSentence1);
                $("#a2").html(data.oneSentence2);
                $("#a3").html(data.oneSentence3);
                $("#a4").html(data.oneSentence4);
                $("#a5").html(data.oneSentence5);
                $("#d1").html(data.fourSentence1);
                $("#d2").html(data.fourSentence2);
                $("#d3").html(data.fourSentence3);
                $("#d4").html(data.fourSentence4);
                $("#d5").html(data.fourSentence5);
                $("#c1").html(data.threeSentence1);
                $("#c2").html(data.threeSentence2);
                $("#c3").html(data.threeSentence3);
                $("#c4").html(data.threeSentence4);
                $("#c5").html(data.threeSentence5);
                $("#b1").html(data.twoSentence1);
                $("#b2").html(data.twoSentence2);
                $("#b3").html(data.twoSentence3);
                $("#b4").html(data.twoSentence4);
                $("#b5").html(data.twoSentence5);
                // alert("数据: \n" + data + "\n状态: " + status);
            });
    }



    function query7() {
        if(count()==28){
            alert("请输入查询的内容，最多三个字！")
            return
        }

        $.post("/poetry/read7",
            {   count:0,
                oneSentence1:$("#a71").text(),
                oneSentence2:$("#a72").text(),
                oneSentence3:$("#a73").text(),
                oneSentence4:$("#a74").text(),
                oneSentence5:$("#a75").text(),
                oneSentence6:$("#a76").text(),
                oneSentence7:$("#a77").text(),
                twoSentence1:$("#b71").text(),
                twoSentence2:$("#b72").text(),
                twoSentence3:$("#b73").text(),
                twoSentence4:$("#b74").text(),
                twoSentence5:$("#b75").text(),
                twoSentence6:$("#b76").text(),
                twoSentence7:$("#b77").text(),
                threeSentence1:$("#c71").text(),
                threeSentence2:$("#c72").text(),
                threeSentence3:$("#c73").text(),
                threeSentence4:$("#c74").text(),
                threeSentence5:$("#c75").text(),
                threeSentence6:$("#c76").text(),
                threeSentence7:$("#c77").text(),
                fourSentence1:$("#d71").text(),
                fourSentence2:$("#d72").text(),
                fourSentence3:$("#d73").text(),
                fourSentence4:$("#d74").text(),
                fourSentence5:$("#d75").text(),
                fourSentence6:$("#d76").text(),
                fourSentence7:$("#d77").text()
            },
            function(data){
                console.log(data);
                if (data.oneSentence1==null){
                    alert("未查到数据，请重查！")
                    return
                }
                $("#verse7").val(data.count);
                $("#a71").html(data.oneSentence1);
                $("#a72").html(data.oneSentence2);
                $("#a73").html(data.oneSentence3);
                $("#a74").html(data.oneSentence4);
                $("#a75").html(data.oneSentence5);
                $("#a76").html(data.oneSentence6);
                $("#a77").html(data.oneSentence7);
                $("#d71").html(data.fourSentence1);
                $("#d72").html(data.fourSentence2);
                $("#d73").html(data.fourSentence3);
                $("#d74").html(data.fourSentence4);
                $("#d75").html(data.fourSentence5);
                $("#d76").html(data.fourSentence6);
                $("#d77").html(data.fourSentence7);
                $("#c71").html(data.threeSentence1);
                $("#c72").html(data.threeSentence2);
                $("#c73").html(data.threeSentence3);
                $("#c74").html(data.threeSentence4);
                $("#c75").html(data.threeSentence5);
                $("#c76").html(data.threeSentence6);
                $("#c77").html(data.threeSentence7);
                $("#b71").html(data.twoSentence1);
                $("#b72").html(data.twoSentence2);
                $("#b73").html(data.twoSentence3);
                $("#b74").html(data.twoSentence4);
                $("#b75").html(data.twoSentence5);
                $("#b76").html(data.twoSentence6);
                $("#b77").html(data.twoSentence7);
                // alert("数据: \n" + data + "\n状态: " + status);
            });
    }





    function query555shang() {

        var count=parseInt($("#verse5").val())-1;
        if(count<0){
            alert("已经是第一首诗了")
            return;
        }
        query555(count);

    }
    function query555xia() {
        var count=parseInt($("#verse5").val())+1;
        query555(count);
    }
    function query555(count) {

         if ($("#verse51").val()=="a1"){
             var a1=$("#a1").text();
         } else if($("#verse52").val()=="a1"){
             var a1=$("#a1").text();
         }else if($("#verse53").val()=="a1"){
             var a1=$("#a1").text();
         }else {
             var a1='*';
         }

        if ($("#verse51").val()=="a2"){
            var a2=$("#a2").text();
        } else if($("#verse52").val()=="a2"){
            var a2=$("#a2").text();
        }else if($("#verse53").val()=="a2"){
            var a2=$("#a2").text();
        }else {
            var a2='*';
        }
        if ($("#verse51").val()=="a3"){
            var a3=$("#a3").text();
        } else if($("#verse52").val()=="a3"){
            var a3=$("#a3").text();
        }else if($("#verse53").val()=="a3"){
            var a3=$("#a3").text();
        }else {
            var a3='*';
        }
        if ($("#verse51").val()=="a4"){
            var a4=$("#a4").text();
        } else if($("#verse52").val()=="a4"){
            var a4=$("#a4").text();
        }else if($("#verse53").val()=="a4"){
            var a4=$("#a4").text();
        }else {
            var a4='*';
        }
        if ($("#verse51").val()=="a5"){
            var a5=$("#a5").text();
        } else if($("#verse52").val()=="a5"){
            var a5=$("#a5").text();
        }else if($("#verse53").val()=="a5"){
            var a5=$("#a5").text();
        }else {
            var a5='*';
        }

        if ($("#verse51").val()=="b1"){
            var b1=$("#b1").text();
        } else if($("#verse52").val()=="b1"){
            var b1=$("#b1").text();
        }else if($("#verse53").val()=="b1"){
            var b1=$("#b1").text();
        }else {
            var b1='*';
        }
        if ($("#verse51").val()=="b2"){
            var b2=$("#b2").text();
        } else if($("#verse52").val()=="b2"){
            var b2=$("#b2").text();
        }else if($("#verse53").val()=="b2"){
            var b2=$("#b2").text();
        }else {
            var b2='*';
        }
        if ($("#verse51").val()=="b3"){
            var b3=$("#b3").text();
        } else if($("#verse52").val()=="b3"){
            var b3=$("#b3").text();
        }else if($("#verse53").val()=="b3"){
            var b3=$("#b3").text();
        }else {
            var b3='*';
        }
        if ($("#verse51").val()=="b4"){
            var b4=$("#b4").text();
        } else if($("#verse52").val()=="b4"){
            var b4=$("#b4").text();
        }else if($("#verse53").val()=="b4"){
            var b4=$("#b4").text();
        }else {
            var b4='*';
        }
        if ($("#verse51").val()=="b5"){
            var b5=$("#b5").text();
        } else if($("#verse52").val()=="b5"){
            var b5=$("#b5").text();
        }else if($("#verse53").val()=="b5"){
            var b5=$("#b5").text();
        }else {
            var b5='*';
        }
        if ($("#verse51").val()=="c1"){
            var c1=$("#c1").text();
        } else if($("#verse52").val()=="c1"){
            var c1=$("#c1").text();
        }else if($("#verse53").val()=="c1"){
            var c1=$("#c1").text();
        }else {
            var c1='*';
        }
        if ($("#verse51").val()=="c2"){
            var c2=$("#c2").text();
        } else if($("#verse52").val()=="c2"){
            var c2=$("#c2").text();
        }else if($("#verse53").val()=="c2"){
            var c2=$("#c2").text();
        }else {
            var c2='*';
        }
        if ($("#verse51").val()=="c3"){
            var c3=$("#c3").text();
        } else if($("#verse52").val()=="c3"){
            var c3=$("#c3").text();
        }else if($("#verse53").val()=="c3"){
            var c3=$("#c3").text();
        }else {
            var c3='*';
        }
        if ($("#verse51").val()=="c4"){
            var c4=$("#c4").text();
        } else if($("#verse52").val()=="c4"){
            var c4=$("#c4").text();
        }else if($("#verse53").val()=="c4"){
            var c4=$("#c4").text();
        }else {
            var c4='*';
        }
        if ($("#verse51").val()=="c5"){
            var c5=$("#c5").text();
        } else if($("#verse52").val()=="c5"){
            var c5=$("#c5").text();
        }else if($("#verse53").val()=="c5"){
            var c5=$("#c5").text();
        }else {
            var c5='*';
        }
        if ($("#verse51").val()=="d1"){
            var d1=$("#d1").text();
        } else if($("#verse52").val()=="d1"){
            var d1=$("#d1").text();
        }else if($("#verse53").val()=="d1"){
            var d1=$("#d1").text();
        }else {
            var d1='*';
        }
        if ($("#verse51").val()=="d2"){
            var d2=$("#d2").text();
        } else if($("#verse52").val()=="d2"){
            var d2=$("#d2").text();
        }else if($("#verse53").val()=="d2"){
            var d2=$("#d2").text();
        }else {
            var d2='*';
        }
        if ($("#verse51").val()=="d3"){
            var d3=$("#d3").text();
        } else if($("#verse52").val()=="d3"){
            var d3=$("#d3").text();
        }else if($("#verse53").val()=="d3"){
            var d3=$("#d3").text();
        }else {
            var d3='*';
        }
        if ($("#verse51").val()=="d4"){
            var d4=$("#d4").text();
        } else if($("#verse52").val()=="d4"){
            var d4=$("#d4").text();
        }else if($("#verse53").val()=="d4"){
            var d4=$("#d4").text();
        }else {
            var d4='*';
        }
        if ($("#verse51").val()=="d5"){
            var d5=$("#d5").text();
        } else if($("#verse52").val()=="d5"){
            var d5=$("#d5").text();
        }else if($("#verse53").val()=="d5"){
            var d5=$("#d5").text();
        }else {
            var d5='*';
        }
        $.post("/poetry/read5",
            {
                count: count,
                oneSentence1: a1,
                oneSentence2: a2,
                oneSentence3: a3,
                oneSentence4: a4,
                oneSentence5: a5,
                twoSentence1: b1,
                twoSentence2: b2,
                twoSentence3: b3,
                twoSentence4: b4,
                twoSentence5: b5,
                threeSentence1: c1,
                threeSentence2: c2,
                threeSentence3: c3,
                threeSentence4: c4,
                threeSentence5: c5,
                fourSentence1: d1,
                fourSentence2: d2,
                fourSentence3: d3,
                fourSentence4: d4,
                fourSentence5: d5
            },
            function (data) {
                console.log(data);
                if (data.oneSentence1 == null) {
                    if (data.count == -1) {
                        alert("已经是最后一首了！")
                        return
                    }
                    alert("未查到数据，请重查！")
                    return
                }

                $("#verse5").val(data.count);
                $("#a1").html(data.oneSentence1);
                $("#a2").html(data.oneSentence2);
                $("#a3").html(data.oneSentence3);
                $("#a4").html(data.oneSentence4);
                $("#a5").html(data.oneSentence5);
                $("#d1").html(data.fourSentence1);
                $("#d2").html(data.fourSentence2);
                $("#d3").html(data.fourSentence3);
                $("#d4").html(data.fourSentence4);
                $("#d5").html(data.fourSentence5);
                $("#c1").html(data.threeSentence1);
                $("#c2").html(data.threeSentence2);
                $("#c3").html(data.threeSentence3);
                $("#c4").html(data.threeSentence4);
                $("#c5").html(data.threeSentence5);
                $("#b1").html(data.twoSentence1);
                $("#b2").html(data.twoSentence2);
                $("#b3").html(data.twoSentence3);
                $("#b4").html(data.twoSentence4);
                $("#b5").html(data.twoSentence5);
                // alert("数据: \n" + data + "\n状态: " + status);
            });
    }


    function query777shang() {

        var count=parseInt($("#verse7").val())-1;
        if(count<0){
            alert("已经是第一首诗了")
            return;
        }
        query777(count);

    }
    function query777xia() {
        var count=parseInt($("#verse7").val())+1;
        query777(count);
    }
    function query777(count) {
        if ($("#verse71").val()=="a71"){
            var a71=$("#a71").text();
        } else if($("#verse72").val()=="a71"){
            var a71=$("#a71").text();
        }else if($("#verse73").val()=="a71"){
            var a71=$("#a71").text();
        }else {
            var a71='*';
        }
        if ($("#verse71").val()=="a72"){
            var a72=$("#a72").text();
        } else if($("#verse72").val()=="a72"){
            var a72=$("#a72").text();
        }else if($("#verse73").val()=="a72"){
            var a72=$("#a72").text();
        }else {
            var a72='*';
        }
        if ($("#verse71").val()=="a73"){
            var a73=$("#a73").text();
        } else if($("#verse72").val()=="a73"){
            var a73=$("#a73").text();
        }else if($("#verse73").val()=="a73"){
            var a73=$("#a73").text();
        }else {
            var a73='*';
        }
        if ($("#verse71").val()=="a74"){
            var a74=$("#a74").text();
        } else if($("#verse72").val()=="a74"){
            var a74=$("#a74").text();
        }else if($("#verse73").val()=="a74"){
            var a74=$("#a74").text();
        }else {
            var a74='*';
        }
        if ($("#verse71").val()=="a75"){
            var a75=$("#a75").text();
        } else if($("#verse72").val()=="a75"){
            var a75=$("#a75").text();
        }else if($("#verse73").val()=="a75"){
            var a75=$("#a75").text();
        }else {
            var a75='*';
        }
        if ($("#verse71").val()=="a76"){
            var a76=$("#a76").text();
        } else if($("#verse72").val()=="a76"){
            var a76=$("#a76").text();
        }else if($("#verse73").val()=="a76"){
            var a76=$("#a76").text();
        }else {
            var a76='*';
        }
        if ($("#verse71").val()=="a77"){
            var a77=$("#a77").text();
        } else if($("#verse72").val()=="a77"){
            var a77=$("#a77").text();
        }else if($("#verse73").val()=="a77"){
            var a77=$("#a77").text();
        }else {
            var a77='*';
        }
        if ($("#verse71").val()=="b71"){
            var b71=$("#b71").text();
        } else if($("#verse72").val()=="b71"){
            var b71=$("#b71").text();
        }else if($("#verse73").val()=="b71"){
            var b71=$("#b71").text();
        }else {
            var b71='*';
        }
        if ($("#verse71").val()=="b72"){
            var b72=$("#b72").text();
        } else if($("#verse72").val()=="b72"){
            var b72=$("#b72").text();
        }else if($("#verse73").val()=="b72"){
            var b72=$("#b72").text();
        }else {
            var b72='*';
        }
        if ($("#verse71").val()=="b73"){
            var b73=$("#b73").text();
        } else if($("#verse72").val()=="b73"){
            var b73=$("#b73").text();
        }else if($("#verse73").val()=="b73"){
            var b73=$("#b73").text();
        }else {
            var b73='*';
        }
        if ($("#verse71").val()=="b74"){
            var b74=$("#b74").text();
        } else if($("#verse72").val()=="b74"){
            var b74=$("#b74").text();
        }else if($("#verse73").val()=="b74"){
            var b74=$("#b74").text();
        }else {
            var b74='*';
        }
        if ($("#verse71").val()=="b75"){
            var b75=$("#b75").text();
        } else if($("#verse72").val()=="b75"){
            var b75=$("#b75").text();
        }else if($("#verse73").val()=="b75"){
            var b75=$("#b75").text();
        }else {
            var b75='*';
        }
        if ($("#verse71").val()=="b76"){
            var b76=$("#b76").text();
        } else if($("#verse72").val()=="b76"){
            var b76=$("#b76").text();
        }else if($("#verse73").val()=="b76"){
            var b76=$("#b76").text();
        }else {
            var b76='*';
        }
        if ($("#verse71").val()=="b77"){
            var b77=$("#b77").text();
        } else if($("#verse72").val()=="b77"){
            var b77=$("#b77").text();
        }else if($("#verse73").val()=="b77"){
            var b77=$("#b77").text();
        }else {
            var b77='*';
        }
        if ($("#verse71").val()=="c71"){
            var c71=$("#c71").text();
        } else if($("#verse72").val()=="c71"){
            var c71=$("#c71").text();
        }else if($("#verse73").val()=="c71"){
            var c71=$("#c71").text();
        }else {
            var c71='*';
        }
        if ($("#verse71").val()=="c72"){
            var c72=$("#c72").text();
        } else if($("#verse72").val()=="c72"){
            var c72=$("#c72").text();
        }else if($("#verse73").val()=="c72"){
            var c72=$("#c72").text();
        }else {
            var c72='*';
        }
        if ($("#verse71").val()=="c73"){
            var c73=$("#c73").text();
        } else if($("#verse72").val()=="c73"){
            var c73=$("#c73").text();
        }else if($("#verse73").val()=="c73"){
            var c73=$("#c73").text();
        }else {
            var c73='*';
        }
        if ($("#verse71").val()=="c74"){
            var c74=$("#c74").text();
        } else if($("#verse72").val()=="c74"){
            var c74=$("#c74").text();
        }else if($("#verse73").val()=="c74"){
            var c74=$("#c74").text();
        }else {
            var c74='*';
        }
        if ($("#verse71").val()=="c75"){
            var c75=$("#c75").text();
        } else if($("#verse72").val()=="c75"){
            var c75=$("#c75").text();
        }else if($("#verse73").val()=="c75"){
            var c75=$("#c75").text();
        }else {
            var c75='*';
        }
        if ($("#verse71").val()=="c76"){
            var c76=$("#c76").text();
        } else if($("#verse72").val()=="c76"){
            var c76=$("#c76").text();
        }else if($("#verse73").val()=="c76"){
            var c76=$("#c76").text();
        }else {
            var c76='*';
        }
        if ($("#verse71").val()=="c77"){
            var c77=$("#c77").text();
        } else if($("#verse72").val()=="c77"){
            var c77=$("#c77").text();
        }else if($("#verse73").val()=="c77"){
            var c77=$("#c77").text();
        }else {
            var c77='*';
        }
        if ($("#verse71").val()=="d71"){
            var d71=$("#d71").text();
        } else if($("#verse72").val()=="d71"){
            var d71=$("#d71").text();
        }else if($("#verse73").val()=="d71"){
            var d71=$("#d71").text();
        }else {
            var d71='*';
        }
        if ($("#verse71").val()=="d72"){
            var d72=$("#d72").text();
        } else if($("#verse72").val()=="d72"){
            var d72=$("#d72").text();
        }else if($("#verse73").val()=="d72"){
            var d72=$("#d72").text();
        }else {
            var d72='*';
        }
        if ($("#verse71").val()=="d73"){
            var d73=$("#d73").text();
        } else if($("#verse72").val()=="d73"){
            var d73=$("#d73").text();
        }else if($("#verse73").val()=="d73"){
            var d73=$("#d73").text();
        }else {
            var d73='*';
        }
        if ($("#verse71").val()=="d74"){
            var d74=$("#d74").text();
        } else if($("#verse72").val()=="d74"){
            var d74=$("#d74").text();
        }else if($("#verse73").val()=="d74"){
            var d74=$("#d74").text();
        }else {
            var d74='*';
        }
        if ($("#verse71").val()=="d75"){
            var d75=$("#d75").text();
        } else if($("#verse72").val()=="d75"){
            var d75=$("#d75").text();
        }else if($("#verse73").val()=="d75"){
            var d75=$("#d75").text();
        }else {
            var d75='*';
        }
        if ($("#verse71").val()=="d76"){
            var d76=$("#d76").text();
        } else if($("#verse72").val()=="d76"){
            var d76=$("#d76").text();
        }else if($("#verse73").val()=="d76"){
            var d76=$("#d76").text();
        }else {
            var d76='*';
        }
        if ($("#verse71").val()=="d77"){
            var d77=$("#d77").text();
        } else if($("#verse72").val()=="d77"){
            var d77=$("#d77").text();
        }else if($("#verse73").val()=="d77"){
            var d77=$("#d77").text();
        }else {
            var d77='*';
        }
        $.post("/poetry/read7",
            {
                count: count,
                oneSentence1:a71,
                oneSentence2:a72,
                oneSentence3:a73,
                oneSentence4:a74,
                oneSentence5:a75,
                oneSentence6:a76,
                oneSentence7:a77,
                twoSentence1:b71,
                twoSentence2:b72,
                twoSentence3:b73,
                twoSentence4:b74,
                twoSentence5:b75,
                twoSentence6:b76,
                twoSentence7:b77,
                threeSentence1:c71,
                threeSentence2:c72,
                threeSentence3:c73,
                threeSentence4:c74,
                threeSentence5:c75,
                threeSentence6:c76,
                threeSentence7:c77,
                fourSentence1:d71,
                fourSentence2:d72,
                fourSentence3:d73,
                fourSentence4:d74,
                fourSentence5:d75,
                fourSentence6:d76,
                fourSentence7:d77
            },
            function(data){
                if (data.oneSentence1 == null) {
                    if (data.count == -1) {
                        alert("已经是最后一首了！")
                        return
                    }
                    alert("未查到数据，请重查！")
                    return
                }

                $("#verse7").val(data.count);
                $("#a71").html(data.oneSentence1);
                $("#a72").html(data.oneSentence2);
                $("#a73").html(data.oneSentence3);
                $("#a74").html(data.oneSentence4);
                $("#a75").html(data.oneSentence5);
                $("#a76").html(data.oneSentence6);
                $("#a77").html(data.oneSentence7);
                $("#d71").html(data.fourSentence1);
                $("#d72").html(data.fourSentence2);
                $("#d73").html(data.fourSentence3);
                $("#d74").html(data.fourSentence4);
                $("#d75").html(data.fourSentence5);
                $("#d76").html(data.fourSentence6);
                $("#d77").html(data.fourSentence7);
                $("#c71").html(data.threeSentence1);
                $("#c72").html(data.threeSentence2);
                $("#c73").html(data.threeSentence3);
                $("#c74").html(data.threeSentence4);
                $("#c75").html(data.threeSentence5);
                $("#c76").html(data.threeSentence6);
                $("#c77").html(data.threeSentence7);
                $("#b71").html(data.twoSentence1);
                $("#b72").html(data.twoSentence2);
                $("#b73").html(data.twoSentence3);
                $("#b74").html(data.twoSentence4);
                $("#b75").html(data.twoSentence5);
                $("#b76").html(data.twoSentence6);
                $("#b77").html(data.twoSentence7);
                // alert("数据: \n" + data + "\n状态: " + status);
            });
    }
</script>
</body>
</html>